<?php

 require_once("../test/php_connect.php");
 require_once("../lib/fonctions_requete_sql.php");
 require_once("../lib/tableau_association.php");

$connexion = new PDO('mysql:host='.$PARAM_hote.';dbname='.$PARAM_nom_bd, $PARAM_utilisateur, $PARAM_mot_passe,array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));
//$id=11;
$id= $_POST["id"];
$requete = "INSERT INTO usager (`id_etablissement` ,
								`id_etablissement_facturation` ,
								`matricule` ,
								`date_creation` ,
								`num_poste` ,
								`region` ,
								`departement` ,
								`classification` ,
								`num_salaries` ,
								`nb_particip_concerne` ,
								`potentiel_particip` ,
								`nbbrochure` ,
								`date_hiver` ,
								`date_inscription_hiver` ,
								`date_ete` ,
								`date_inscription_ete` ,
								`fonctionnement_collect`)
                   (SELECT `id_etablissement` ,
							`id_etablissement_facturation` ,
							`matricule` ,
							`date_creation` ,
							`num_poste` ,
							`region` ,
							`departement` ,
							`classification` ,
							`num_salaries` ,
							`nb_particip_concerne` ,
							`potentiel_particip` ,
							`nbbrochure` ,
							`date_hiver` ,
							`date_inscription_hiver` ,
							`date_ete` ,
							`date_inscription_ete` ,
							`fonctionnement_collect`
                     FROM prospect 
                     WHERE id_prospect = $id)";

$req = $connexion->prepare($requete);
$req->execute();
$requete = "DELETE FROM prospect WHERE id_prospect = $id";
$req = $connexion->prepare($requete);
$req->execute();
echo $id;
?>